<?xml version="1.0" encoding="utf-8"?>
<!--
                                                                                     
 h       t     t                ::       /     /                     t             / 
 h       t     t                ::      //    //                     t            // 
 h     ttttt ttttt ppppp sssss         //    //  y   y       sssss ttttt         //  
 hhhh    t     t   p   p s            //    //   y   y       s       t          //   
 h  hh   t     t   ppppp sssss       //    //    yyyyy       sssss   t         //    
 h   h   t     t   p         s  ::   /     /         y  ..       s   t    ..   /     
 h   h   t     t   p     sssss  ::   /     /     yyyyy  ..   sssss   t    ..   /     
                                                                                     
	<https://y.st./>
	Copyright © 2016 Alex Yst <mailto:copyright@y.st>

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program. If not, see <https://www.gnu.org./licenses/>.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="https://y.st./en/weblog/2016/01-January/16.xhtml"/>
		<title>Exceptions and shared memory &lt;https://y.st./en/weblog/2016/01-January/16.xhtml&gt;</title>
		<link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png"/>
		<link rel="stylesheet" type="text/css" href="/link/main.css"/>
		<script type="text/javascript" src="/script/javascript.js"/>
		<meta name="viewport" content="width=device-width"/>
	</head>
	<body>
<nav>
	<p>
		<a href="/en/coursework/">Coursework</a> |
		<a href="/en/take-down/">Take-down requests</a> |
		<a href="/en/">Home</a> |
		<a href="/en/a/about.xhtml">About</a> |
		<a href="/en/a/contact.xhtml">Contact</a> |
		<a href="/a/canary.txt">Canary</a> |
		<a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
		<a href="/en/opinion/">Opinions</a> |
		<a href="/en/law/">Law</a> |
		<a href="/en/recipe/">Recipes</a> |
		<a href="/en/a/links.xhtml">Links</a> |
		<a href="/en/weblog/2016/01-January/16.xhtml.asc">{this page}.asc</a>
	</p>
	<hr/>
	<p>
		Weblog index:
		<a href="/en/weblog/memories">Memories</a> |
		<a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
		<a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
		<a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
	</p>
	<hr/>
	<p>
		Jump to entry:
		<a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
		<a rel="prev" href="/en/weblog/2016/01-January/15.xhtml">&lt;Previous</a>
		<a rel="next" href="/en/weblog/2016/01-January/17.xhtml">Next&gt;</a>
		<a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
			</p>
			<hr/>
</nav>
		<header>
			<h1>Exceptions and shared memory</h1>
			<p>Day 00315: <time>Saturday, 2016 January 16</time></p>
		</header>
<p>
	Last night, I had a pretty bad dream in which my laptop was starting to break down physically.
	The metal part where the hinge attaches to the screen was bending apart.
	The screen was starting to detach and it was only a matter of time before it was no longer functional.
	Once awake though, I realized that this laptop was not my own <a href="/en/domains/cepo.local.xhtml"><code>cepo</code></a> though.
	Cepo&apos;s shell is made of plastic, not metal.
	Still, what does this dream mean? Does it mean that I fear the destruction of my laptop?
</p>
<p>
	The power went out this morning.
	By the spider&apos;s own estimate, it was over halfway finished crawling that large website that I keep trying to have it crawl, but once again, it is going to have to start over.
	It had crawled 37890 pages and had an estimated 19770 pages left.
	I really hope some day to move past this site.
</p>
<p>
	Feeling stranded without Internet access, I used what power I had left in <code>cepo</code>&apos;s battery to work on wrapper classes.
	It is a good thing that I downloaded that <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> manual.
	Thankfully, the <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> website even offers a full-manual download option instead of requiring each page be visited and downloaded manually.
	Furthermore, the manual is under the <abbr title="Creative Commons Attribution 3.0 Unported">CC BY 3.0</abbr> license, so I do not have to feel bad about having a copy of it on my machine.
	I built the functions covered by today&apos;s section of the manual into three small classes dealing with shared memory.
	I experimented a bit, and it seems like if modified my spider to make use of them, it should be possible to set up a script that can check on the spider&apos;s progress without keeping the spider open in my terminal window at all times.
	It might not be able to allow me to hook into the continuing output flow that I would have if I kept it running in my terminal window, but it would give me the freedom to allow <a href="/en/domains/newdawn.local.xhtml"><code>newdawn</code></a> to be put to sleep at night, or even take <code>newdawn</code> outside the house if desired.
</p>
<p>
	As it turns out, we did not do much at the library in regards to Cyrus&apos; project.
	He needed to measure some shelves, but that was all.
	After that, he and our mother went home, while Vanessa and I stayed to participate in the monthly coloring club.
	Last time, i was somewhat unprepared.
	It was a fun idea in theory, but we were coloring ostensibly nonfree works.
	This time, I asked for a blank sheet of paper and did my best to draw <a href="http://floraverse.com/">Floraverse</a>&apos;s Andre from memory.
	I messed it up quite a bit, but it was still fun.
	After that, I started working on a line drawing using a ruler, but quickly realized that that was a bad idea.
	My underlying goal in attendance it to improve my eye hand coordination.
	Drawing lines using a ruler does not help me to do that.
</p>
<p>
	After Vanessa and I returned home, we met back up with Cyrus and our mother and attended an earthquake lecture at the local community collage.
	Much of the lecture was either about things I already knew or were above my head, but one important fact did stand out: the data that these people are gathering about seismic activity is publicly accessible.
	The people speaking at the lecture are the <a href="https://pnsn.org/">Pacific Northwest Seismic Network</a>, and their current goal seems to be to learn more about the fault line that lies just off the local coast in fairly shallow water.
	The lecturer also mentioned the <a href="/en/weblog/2015/07-July/04.xhtml">minor earthquake in Springfield not too long ago</a>, explaining that the reason that it was so weak is that it originated within the crust.
	Had it originated deep in the mantle, it would have been stronger, or if it had originated at a fault line, it would have possibly been devastating.
</p>
<p>
	Whenever I write my code to throw exceptions in case of error, I have to go back to the two lists of exceptions built into <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> to try to find the best exception for the job.
	Furthermore, the lists do not have information with them, instead they have links to the pages that do have the information.
	In other words, the manual is organized, and these lists are only indexes.
	However, I have been thinking for quite some time that I could really use a list for quick reference.
	Today, I sat down to create such a list.
	I understand that it is helpful to define one&apos;s own exceptions when one is using them in catch blocks and only wants to catch certain types of errors, but I think that in most other cases, it is better just to use the built-in exceptions.
	That said, it is probably best to use the most specific available exception that applies to the situation, so I also organized the exceptions into the following list so I could better visualize the built-in exception hierarchy:
</p>
<ul>
	<li><a href="https://secure.php.net/manual/en/class.throwable.php"><code>\Throwable</code></a><ul>
			<li><a href="https://secure.php.net/manual/en/class.error.php"><code>\Error</code></a><ul>
				<li><a href="https://secure.php.net/manual/en/class.arithmeticerror.php"><code>\ArithmeticError</code></a><ul>
					<li><a href="https://secure.php.net/manual/en/class.divisionbyzeroerror.php"><code>\DivisionByZeroError</code></a></li>
				</ul></li>
			<li><a href="https://secure.php.net/manual/en/class.assertionerror.php"><code>\AssertionError</code></a></li>
			<li><a href="https://secure.php.net/manual/en/class.parseerror.php"><code>\ParseError</code></a></li>
			<li><a href="https://secure.php.net/manual/en/class.typeerror.php"><code>\TypeError</code></a></li>
		</ul></li>
		<li><a href="https://secure.php.net/manual/en/class.exception.php"><code>\Exception</code></a><ul>
			<li><a href="https://secure.php.net/manual/en/class.errorexception.php"><code>\ErrorException</code></a></li>
			<li><a href="https://secure.php.net/manual/en/class.logicexception.php"><code>\LogicException</code></a><ul>
				<li><a href="https://secure.php.net/manual/en/class.badfunctioncallexception.php"><code>\BadFunctionCallException</code></a><ul>
					<li><a href="https://secure.php.net/manual/en/class.badmethodcallexception.php"><code>\BadMethodCallException</code></a></li>
				</ul></li>
				<li><a href="https://secure.php.net/manual/en/class.domainexception.php"><code>\DomainException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.invalidargumentexception.php"><code>\InvalidArgumentException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.lengthexception.php"><code>\LengthException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.outofrangeexception.php"><code>\OutOfRangeException</code></a></li>
			</ul></li>
			<li><a href="https://secure.php.net/manual/en/class.runtimeexception.php"><code>\RuntimeException</code></a><ul>
				<li><a href="https://secure.php.net/manual/en/class.outofboundsexception.php"><code>\OutOfBoundsException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.overflowexception.php"><code>\OverflowException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.rangeexception.php"><code>\RangeException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.underflowexception.php"><code>\UnderflowException</code></a></li>
				<li><a href="https://secure.php.net/manual/en/class.unexpectedvalueexception.php"><code>\UnexpectedValueException</code></a></li>
			</ul></li>
		</ul></li>
	</ul></li>
</ul>
<p>
	It is worth noting that the <code>\Throwable</code> interface and everything in the <code>\Error</code> branch of the tree are only available in <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> 7, not in <abbr title="PHP: Hypertext Preprocessor">PHP</abbr>5.
	It seems that <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> 7 is built to be more object-oriented than <abbr title="PHP: Hypertext Preprocessor">PHP</abbr> 5, so these added exceptions are available for internal use, allowing the language to throw exceptions instead of raising errors.
	It sounds like if these built-in exceptions are not caught, the regular error handler will be called, but hopefully the exception&apos;s backtrace will be kept intact when this happens and will be output with the error message.
</p>
<p>
	Before going to bed, our mother gave Vanessa, Cyrus, and I a strange quiz that made me nervous.
	Much of it was about how we feel about things, but with her being the type to overreact about things and in many ways be intolerant, I did feel the need to lie in my answers.
	I talked to Cyrus later, and is seems that he had come to a similar conclusion when he had assessed the situation.
	I did not get a chance to speak with Vanessa about it, but my guess is that she reached the same conclusion that we did and took the same precautionary measures.
</p>
<p>
	This winter, I was pretty cold, as most of the blankets that we have are made from animal products, so I refused to use them.
	At least, that is what I thought at the time.
	I had thought that fleece was synthetic, but someone told me that it was an animal product.
	Being busy, I never looked into it, but the other day, someone else told me that fleece is made of polyester! I looked into it today, and it turns out that the cloth that people typically call &quot;fleece&quot; is actually called <a href="https://en.wikipedia.org/wiki/Polar_fleece">polar fleece</a>.
	This fabric is also known as &quot;polar wool&quot;, &quot;vega wool&quot;, and &quot;velo wools&quot;, but despite its animal-sounding names, it is made of <a href="https://en.wikipedia.org/wiki/Polyethylene_terephthalate">polyethylene terephthalate</a>, a type of polyester.
	Fleece is just plastic! Had I actually done research when I was told that it was an animal product, I could have been warm this winter.
</p>
<p>
	It seems that <a href="https://opalrwf4mzmlfmag.onion/">wowaname</a>&apos;s server is back up! That must be a relief for her.
	When my server is down, I feel stranded, even if my laptop is still online.
	I assume that she feels similarly.
</p>
<p>
	It sounds like the plan to go to Eugene and Springfield tomorrow or the next day may still happen.
	If this does happen before the spider finishes crawling the huge website that it is working with, it will once again have to be interrupted.
	It will have to begin its progress from scratch yet again.
	The alternative is to leave <code>newdawn</code> in Coos Bay, but that would mean potentially being unable to write a journal entry or two while events are still fresh in my mind.
</p>
<p>
	My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
</p>
		<hr/>
		<p>
			Copyright © 2016 Alex Yst;
			You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
			If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
			My address is in the source comments near the top of this document.
			This license also applies to embedded content such as images.
			For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
		</p>
		<p>
			<abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
			This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F16.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.2</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2016%2F01-January%2F16.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
		</p>
	</body>
</html>

